<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../">
  <title data-ice="title">JsIterator | jstreemap Library</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  <script src="script/manual.js"></script>
<meta name="description" content="Associative containers (sets, maps) library for JavaScript, using red-black trees."><meta property="twitter:card" content="summary"><meta property="twitter:title" content="jstreemap Library"><meta property="twitter:description" content="Associative containers (sets, maps) library for JavaScript, using red-black trees."></head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
<a style="position:relative; top:3px;" href="https://github.com/Kirusi/jstreemap"><img width="20px" src="./image/github.png"></a></header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#public">public</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/insertion-result.js~InsertionResult.html">InsertionResult</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/iterators.js~BaseIterator.html">BaseIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/iterators.js~Iterator.html">Iterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/iterators.js~ReverseIterator.html">ReverseIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-map.js~TreeMap.html">TreeMap</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-multimap.js~TreeMultiMap.html">TreeMultiMap</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-multiset.js~TreeMultiSet.html">TreeMultiSet</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/public/tree-set.js~TreeSet.html">TreeSet</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><div class="header-notice">
  <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import {JsIterator} from &apos;<span><a href="file/src/public/js-iterators.js.html#lineNumber23">jstreemap/src/public/js-iterators.js</a></span>&apos;</code></pre></div>
  <span data-ice="access">public</span>
  <span data-ice="kind">class</span>
  
  
  
  <span data-ice="source">| <span><a href="file/src/public/js-iterators.js.html#lineNumber23">source</a></span></span>
</div>

<div class="self-detail detail">
  <h1 data-ice="name">JsIterator</h1>

  

  
  
  
  
  
  
  
  
  

  
  
  <div class="description" data-ice="description"><p>ES6-style forward iterator.</p>
</div>
  

  

  <div data-ice="exampleDocs">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMap();
...
for (let [key, value] of m) {
  console.log(`key: ${key}, value: ${value}`);
}
// iterate values
for (let value of m.values()) {
  console.log(`value: ${value}`);
}</code></pre>
    </div>
</div>

  

  
</div>



<div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/js-iterators.js~JsIterator.html#instance-constructor-constructor">constructor</a></span></span><span class="code" data-ice="signature">(container: <span>*</span>)</span>
        </p>
      </div>
      <div>
        
        
        
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>

<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/js-iterators.js~JsIterator.html#instance-method-[Symbol.iterator]">[Symbol.iterator]</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Support for ES6 for-of loops.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/js-iterators.js~JsIterator.html#instance-method-backwards">backwards</a></span></span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>A reverse iterator for the same container.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="class/src/public/js-iterators.js~JsIterator.html#instance-method-next">next</a></span></span><span class="code" data-ice="signature">(): <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>As documented in ES6 iteration protocol.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>





<div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-constructor-constructor">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">constructor</span><span class="code" data-ice="signature">(container: <span>*</span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/js-iterators.js.html#lineNumber27">source</a></span></span>
    </span>
  </h3>

  
  
  
  

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">container</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  

  

  
  
</div>
</div>

<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-[Symbol.iterator]">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">[Symbol.iterator]</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/js-iterators.js.html#lineNumber75">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Support for ES6 for-of loops.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/js-iterators.js~JsIterator.html">JsIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-backwards">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">backwards</span><span class="code" data-ice="signature">(): <span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/js-iterators.js.html#lineNumber90">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>A reverse iterator for the same container.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="class/src/public/js-iterators.js~JsReverseIterator.html">JsReverseIterator</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMap();
...
// iterate all key-value pairs in reverse order
for (let [key, value] of m.backwards()) {
  console.log(`key: ${key}, value: ${value}`);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-next">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">next</span><span class="code" data-ice="signature">(): <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/src/public/js-iterators.js.html#lineNumber61">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>As documented in ES6 iteration protocol. It can be used for manual iteration.
Iterators are documented here: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators</a></p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>*</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let m = new TreeMap();
...
let jsIt = m.entries();
while (true) {
  let res = it.next();
  if (res.done) {
    break;
  }
  console.log(`key: ${res.value[0]}, value: ${res.value[1]`});
}</code></pre>
    </div>
</div>

  

  
  
</div>
</div>
</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.0.4)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
